const ratings = document.querySelectorAll('.rating')
const sendBtn = document.querySelector('#send')
const panel = document.querySelector('#panel')

let selectRating = '满意'

ratings.forEach(rating => {
    rating.addEventListener('click', () => {
        ratings.forEach(rating2 => {
            rating2.classList.remove('active')
        })

        rating.classList.add('active')
        selectRating = rating.children[1].innerText
    })
})

sendBtn.addEventListener('click', () => {
    panel.innerHTML = `
    <i class="fas fa-heart"></i>
        <strong>感谢您的反馈!</strong>
        <br>
        <strong>评价: ${selectRating}</strong>
    `
})